package com.neuedu.proapi.pojo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class MaxMinScores {
    private String schoolName;
    private String professionalName;
    private Integer maxScore;
    private Integer minScore;

    public Integer getMinScore() {
        return minScore;
    }
    public Integer getMaxScore(){
        return maxScore;
    }

    public void setMinScore(String minScoreStr) {
        // 如果 minScoresStr 是 "-"，将其转换为 null 或其他默认值
        if ("-".equals(minScoreStr)) {
            this.minScore = null;  // 或者 0，依据需求
        } else {
            try {
                this.minScore = Integer.parseInt(minScoreStr);
            } catch (NumberFormatException e) {
                this.minScore = null;  // 如果无法转换为整数，设置为 null
            }
        }
    }

    public void setMaxScore(String maxScoreStr){
        if ("-".equals(maxScoreStr)){
            this.maxScore=null;
        }else {
            try{
                this.maxScore=Integer.parseInt(maxScoreStr);
            }catch (NumberFormatException e){
                this.maxScore=null;
            }
        }
    }
}

